package com.deng.commons.common;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 实体类的基类，封装每个实体类公有的部分(推荐)
 */
@Data
public class BaseEntity implements Serializable {

    @ApiModelProperty("版本号")
    @Version
    private Integer version;

    @ApiModelProperty("是否删除")
    @TableLogic
    private Boolean deleted;

    @ApiModelProperty("添加日期")
    @TableField(fill = FieldFill.INSERT)
    private String createTime;

    @ApiModelProperty("创建人")
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateTime;

    @ApiModelProperty("更新人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

}
